let Person=require("./person");
let Student=require("./student");
let Class=require("./class");
module.exports=class Teacher extends Person{
    constructor(name,age,klass){
        super(name,age);
        this.klass=klass;
    }
    introduce(){
        if(!this.klass){
            return super.introduce()+" I am a Teacher. I teach No Class.";
        }
        else {
            return super.introduce()+" I am a Teacher. I teach Class "+this.klass.number+".";
        }
    }
    introduceWith(Student){
        if(this.klass!=Student.klass){
            return super.introduce()+" I am a Teacher. I don't teach "+Student.name+".";
        }
        else {
            return super.introduce()+" I am a Teacher. I teach "+Student.name+".";
        }
    }
}

